Grokking System Design Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

92% completed

Vote For New Content
System Design Fundamentals
Introduction to System Design
Load Balancing
Introduction to Load Balancing
Load Balancing Algorithms
Uses of Load Balancing
Load Balancer Types
Stateless vs. Stateful Load Balancing
High Availability and Fault Tolerance
Scalability and Performance
Challenges of Load Balancers
API Gateway
Introduction to API Gateway
Usage of API gateway
Advantages and disadvantages of using API gateway
Key Characteristics of Distributed Systems
Scalability
Availability
Latency and Performance
Concurrency and Coordination
Monitoring and Observability
Resilience and Error Handling
Fault Tolerance vs. High Availability
Network Essentials
HTTP vs. HTTPS
TCP vs. UDP
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
URL vs. URI vs. URN
Domain Name System (DNS)
Introduction to DNS
DNS Resolution Process
DNS Load Balancing and High Availability
Caching
Introduction to Caching
Why is Caching Important?
Types of Caching
Cache Replacement Policies
Cache Invalidation
Cache Read Strategies
Cache Coherence and Consistency Models
Caching Challenges
Cache Performance Metrics
CDN
What is CDN?
Origin Server vs. Edge Server
CDN Architecture
Push CDN vs. Pull CDN
Data Partitioning
Introduction to Data Partitioning
Partitioning Methods
Data Sharding Techniques
Benefits of Data Partitioning
Common Problems Associated with Data Partitioning
Proxies
What is a Proxy Server?
Uses of Proxies
VPN vs. Proxy Server
Redundancy and Replication
What is Redundancy?
What is Replication?
Replication Methods
Data Backup vs. Disaster Recovery
CAP & PACELC Theorems
Introduction to CAP Theorem
Components of CAP Theorem
Trade-offs in CAP Theorem
Examples of CAP Theorem in Practice
Beyond CAP Theorem
System Design Trade-offs in Interviews
Databases (SQL vs. NoSQL)
Introduction to Databases
SQL Databases
NoSQL Databases
SQL vs. NoSQL
ACID vs BASE Properties
Real-World Examples and Case Studies
SQL Normalization and Denormalization
In-Memory Database vs. On-Disk Database
Data Replication vs. Data Mirroring
Database Federation
Indexes
What are Indexes?
Types of Indexes
Bloom Filters
Introduction to Bloom Filters
Benefits & Limitations of Bloom Filters
Variants and Extensions of Bloom Filters
Applications of Bloom Filters
Long-Polling vs. WebSockets vs. Server-Sent Events
Difference Between Long-Polling, WebSockets, and Server-Sent Events
Quorum
What is Quorum?
Heartbeat
What is Heartbeat?
Checksum
What is Checksum?
Uses of Checksum
Leader and Follower
What is Leader and Follower Pattern?
Security
What is Security and Privacy?
What is Authentication?
What is Authorization?
Authentication vs. Authorization
OAuth vs. JWT for Authentication
What is Encryption?
What are DDoS Attacks?
Distributed Messaging System
Introduction to Messaging System
Introduction to Kafka
Messaging patterns
Popular Messaging Queue Systems
RabbitMQ vs. Kafka vs. ActiveMQ
Scalability and Performance
Distributed File Systems
What is a Distributed File System?
Architecture of a Distributed File System
Key Components of a DFS
Misc Concepts
Batch Processing vs. Stream Processing
XML vs. JSON
Synchronous vs. Asynchronous Communication
Push vs. Pull Notification Systems
Microservices vs. Serverless Architecture
Message Queues vs. Service Bus
Stateful vs. Stateless Architecture
Event-Driven vs. Polling Architecture
Quiz
XML vs. JSON

XML (eXtensible Markup Language) and JSON (JavaScript Object Notation) are both formats used for storing and transporting data, particularly in the context of web applications. While they serve similar purposes, they have distinct characteristics and are suited to different use cases.

XML

Definition

  • XML is a markup language much like HTML, designed to store and transport data, with a focus on being both human- and machine-readable.

Characteristics

  • Structure: Heavily structured with start and end tags, attributes, and nesting of elements.
  • Verbose: Tends to be more verbose than JSON.
  • Parsing: Requires an XML parser to read and write.
  • Data Types: Treats all data as strings and doesn’t support data types natively.

Use Cases

  • Preferred in complex applications like document processing systems where document format and structure are important.
  • Used in web services like SOAP (Simple Object Access Protocol).
  • Often used in enterprise settings and for configuration files.

Example

<person> <name>John Doe</name> <age>30</age> <city>New York</city> </person>

JSON

Definition

  • JSON is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate.

Characteristics

  • Format: Consists of key-value pairs and array data types, making it less verbose.
  • Parsing: Easily parsed by standard JavaScript functions.
  • Data Types: Supports basic data types like strings, numbers, arrays, and Booleans.
  • Lightweight: Less overhead compared to XML, which makes it a good choice for web and mobile app development.

Use Cases

  • Frequently used in web applications for data interchange between a server and a web application.
  • Common in RESTful APIs (Representational State Transfer).
  • Popular in NoSQL databases like MongoDB, which store data in a JSON-like format.

Example

{ "name": "John Doe", "age": 30, "city": "New York" }

Key Differences

  1. Verbosity:

    • XML is more verbose with a heavier structure.
    • JSON is lightweight and more compact.
  2. Data Types:

    • XML treats all data as strings and doesn’t natively support different data types.
    • JSON supports various data types natively.
  3. Readability and Writeability:

    • XML is less readable and writable for humans but has a strong capability for defining complex structures.
    • JSON is highly readable and writable, with a simple structure.
  4. Parsing:

    • XML requires a parser to be read and written.
    • JSON can be easily parsed by standard JavaScript functions.
  5. Performance:

    • JSON generally offers better performance due to its simplicity and lightweight nature.
    • XML is more demanding in terms of resources due to its complexity.

Conclusion

The choice between XML and JSON often depends on the specific requirements of the application. JSON is typically preferred for web applications due to its simplicity and efficiency, especially with JavaScript-based applications. XML, on the other hand, is suited for applications where the structure of the data is complex and needs clear definition, or in legacy systems where XML is already deeply integrated.

Batch Processing vs. Stream Processing
Synchronous vs. Asynchronous Communication
Mark as Completed

On this page

XML

Definition

Characteristics

Use Cases

Example

JSON

Definition

Characteristics

Use Cases

Example

Key Differences

Conclusion